home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / wbstartlib.lha / WBStart / src / wbstart.h < prev   
C/C++ Source or Header  |  1996-03-13  |  2KB  |  84 lines

  1. /*
  2.  * wbstart.h  V2.0
  3.  *
  4.  * Main include file
  5.  *
  6.  * (c) 1991-1996 Stefan Becker
  7.  */
  8.  
  9. /* OS include files */
  10. #include <dos/dos.h>
  11. #include <dos/dostags.h>
  12. #include <exec/libraries.h>
  13. #include <exec/memory.h>
  14. #include <exec/resident.h>
  15. #include <exec/semaphores.h>
  16. #include <libraries/wbstart.h>
  17. #include <workbench/startup.h>
  18. #include <workbench/workbench.h>
  19.  
  20. /* OS function prototypes */
  21. #include <clib/alib_protos.h>
  22. #include <clib/dos_protos.h>
  23. #include <clib/exec_protos.h>
  24. #include <clib/icon_protos.h>
  25. #include <clib/utility_protos.h>
  26.  
  27. /* OS function inline calls */
  28. #include <pragmas/dos_pragmas.h>
  29. #include <pragmas/exec_pragmas.h>
  30. #include <pragmas/icon_pragmas.h>
  31. #include <pragmas/utility_pragmas.h>
  32.  
  33. /* ANSI C include files */
  34. #include <string.h>
  35.  
  36. /* Revision number */
  37. #define WBSTART_REVISION 0
  38.  
  39. /* Handler states */
  40. #define WBSTART_HANDLER_INACTIVE 0
  41. #define WBSTART_HANDLER_RUNNING  1
  42.  
  43. /* Library base */
  44. struct WBStartBase {
  45.  struct Library          wbsb_Library;     /* Library node                   */
  46.  UWORD                   wbsb_State;       /* Handler state                  */
  47.  BPTR                    wbsb_Segment;     /* Library segment list           */
  48.  struct Process         *wbsb_Process;     /* Pointer to handler process     */
  49.  struct MsgPort         *wbsb_Port;        /* Pointer to handler msg port    */
  50.  struct SignalSemaphore  wbsb_Semaphore;   /* Semaphore to lock Library Base */
  51.  UWORD                   wbsb_Pad1;        /* Long word alignment            */
  52.  struct MsgPort          wbsb_ReplyPort;   /* Common reply port              */
  53.  UWORD                   wbsb_Pad2;        /* Long word alignment            */
  54.  struct Message          wbsb_Message;     /* Common message                 */
  55. };
  56.  
  57. /* Global data */
  58. extern struct Library     *DOSBase;
  59. extern struct Library     *IconBase;
  60. extern struct Library     *SysBase;
  61. extern struct Library     *UtilityBase;
  62. extern struct WBStartBase *WBStartBase;
  63. extern const char          DosName[];
  64.  
  65. /* Function prototypes */
  66. void  WBStartHandler(void);
  67. BOOL  InitMemory(void);
  68. void  DeleteMemory(void);
  69. void *AllocateMemory(ULONG);
  70. void  FreeMemory(void *);
  71. void  InstallWorkbenchPath(void);
  72. void  RemoveWorkbenchPath(void);
  73. BPTR  ScanLoadPath(char *, BPTR);
  74. LONG  StartProgram(struct TagItem *);
  75. void  FreeProcessData(struct Message *, BOOL);
  76.  
  77. /* Debugging */
  78. #ifdef DEBUG
  79. void kprintf(char *, ...);
  80. #define DEBUGLOG(x) x
  81. #else
  82. #define DEBUGLOG(X)
  83. #endif
  84.